package cn.wolfcode.domain;

import cn.wolfcode.enums.NewsEnums;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Getter
@Setter
public class News {
    private Long id;
    private String title;
    private Employee employee;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date creationtIme;
    private Integer level;
    private Boolean isRead;
    private Boolean statuss;
    private String content;

    @Override
    public String toString(){
        return JSON.toJSONString(this);
    }

    public String getLevelName(){
        return NewsEnums.findName(this.level);
    }
}